* ====================================================================================================================================
* Paper title: Taking a gamble: Chinese overseas energy finance and country risk
* Authors: Hanna Niczyporuk (NYU) and Johannes Urpelainen (JOHNS HOPKINS SAIS) 

* Last modified: December 6, 2020

* Data files used:

*nonchina_energysources.dta
*china_energysources.dta
*chinanonchina_mdb_iv.dta
*nonchina_noniv.dta
*chinamdb_noniv.dta


* Purpose: This do file replicates the results presented in the appendix of the paper 
* Remark: Please set up working directory before replicating the results (here the results are saved under 'workingdirectory'
cd "~/workingdirectory"


* ====================================================================================================================================

*Table A1: Hurdle Model: Investment by the Chinese banks (2005-2017)
*The main explanatory variables are turned on one by one.


use "/workingdirectory/chinamdb_noniv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small " fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"


encode country, gen(countryid)
xtset countryid year


*Model 1
xi: churdle linear log_chinafunding rank_norm auto_bin t t2 t3 i.region_wb, ///
select(rank_norm auto_bin )  ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel replace se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm auto_bin , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel replace se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 2
xi: churdle linear log_chinafunding rank_norm auto_bin $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm auto_bin $economy $energy )  ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm auto_bin $economy $energy  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 3
xi: churdle linear log_chinafunding rank_norm political_stability_rounded t t2 t3 i.region_wb, ///
select(rank_norm political_stability_rounded )  ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm political_stability_rounded  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 4

xi: churdle linear log_chinafunding rank_norm political_stability_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm political_stability_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm political_stability_rounded $economy $energy  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 5

xi: churdle linear log_chinafunding rank_norm corruption_rounded t t2 t3 i.region_wb, ///
select(rank_norm corruption_rounded )  ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm corruption_rounded  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 6

xi: churdle linear log_chinafunding rank_norm corruption_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm corruption_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm corruption_rounded $economy $energy  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 7

xi: churdle linear log_chinafunding rank_norm gov_effectiveness_rounded t t2 t3 i.region_wb, ///
select(rank_norm  gov_effectiveness_rounded)  ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm  gov_effectiveness_rounded  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 8

xi: churdle linear log_chinafunding rank_norm gov_effectiveness_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm gov_effectiveness_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA1.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_chinafunding rank_norm gov_effectiveness_rounded $economy $energy  , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA1_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


* ====================================================================================================================================



* ====================================================================================================================================

*Table A2: Hurdle Model: Investment by non-Chinese MDBs (2005-2017)
*The main explanatory variables turned on one by one.

* ====================================================================================================================================

use "/workingdirectory/nonchina_noniv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small " fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"


encode country, gen(countryid)
xtset countryid year


*Model 1
xi: churdle linear log_nonchinafunding rank_norm auto_bin t t2 t3 i.region_wb, ///
select(rank_norm auto_bin )  ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel replace se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm auto_bin , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel replace se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 2
xi: churdle linear log_nonchinafunding rank_norm auto_bin $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm auto_bin $economy $energy )  ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm auto_bin $economy $energy , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 3
xi: churdle linear log_nonchinafunding rank_norm political_stability_rounded t t2 t3 i.region_wb, ///
select(rank_norm political_stability_rounded )  ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm political_stability_rounded , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")


*Model 4

xi: churdle linear log_nonchinafunding rank_norm political_stability_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm political_stability_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm political_stability_rounded $economy $energy , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 5

xi: churdle linear log_nonchinafunding rank_norm corruption_rounded t t2 t3 i.region_wb, ///
select(rank_norm corruption_rounded )  ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm corruption_rounded , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 6

xi: churdle linear log_nonchinafunding rank_norm corruption_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm corruption_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm corruption_rounded $economy $energy , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 7

xi: churdle linear log_nonchinafunding rank_norm gov_effectiveness_rounded t t2 t3 i.region_wb, ///
select(rank_norm  gov_effectiveness_rounded)  ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm  gov_effectiveness_rounded , vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 8

xi: churdle linear log_nonchinafunding rank_norm gov_effectiveness_rounded $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm gov_effectiveness_rounded $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA2.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

probit log_nonchinafunding rank_norm gov_effectiveness_rounded $economy $energy, vce(cluster countryid)
margins, dydx(*) atmeans post
outreg2 using "tableA2_margins.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

* ====================================================================================================================================

*Table A3: Hurdle Model: Investment by the Chinese MDBs (2005-2017)
*The table includes interactions between the GDP per capita and the credit rating.

* ====================================================================================================================================

use "/workingdirectory/chinamdb_noniv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small " fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"


encode country, gen(countryid)
xtset countryid year


xi: churdle linear log_chinafunding c.rank_norm##c.log_gdppc $wgi $economy_small $energy t t2 t3 i.region_wb, ///
select(c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA3.xls" , excel replace se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


xi: churdle linear log_chinafunding c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy t t2 t3 i.region_wb, ///
select(c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA3.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


* ====================================================================================================================================

*Table A4: Hurdle Model: Investment by non-Chinese MDBs (2005-2017)
*The table includes interactions between the GDP per capita and the credit rating.

* ====================================================================================================================================

use "/workingdirectory/nonchina_noniv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small " fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"


encode country, gen(countryid)
xtset countryid year


xi: churdle linear log_nonchinafunding c.rank_norm##c.log_gdppc $wgi $economy_small $energy t t2 t3 i.region_wb, ///
select(c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA4.xls" , excel replace se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


xi: churdle linear log_nonchinafunding c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy t t2 t3 i.region_wb, ///
select(c.rank_norm##c.log_gdppc auto_bin $wgi $economy_small $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA4.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


* ====================================================================================================================================

*Table A5: Hurdle Model: Investment by the Chinese MDBs (2005-2017)
*The sample period is split into to parts and the table presents how the Chinese and non-Chinese investment over 2005-2010 influences the Chinese investment in 2011-2017.

* ====================================================================================================================================
use "/workingdirectory/chinanonchina_mdb_iv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small "trade_perc_gdp_0004mean fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"

encode country, gen(countryid)
keep if 2010<year
drop t t2 t3
gen t=year-2011
gen t2=t*t
gen t3=t*t*t
xtset countryid year


*Model 1
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum  t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum)  ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel  replace se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 2
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin)  ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


*Model 3
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi)  ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 4
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $wgi t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $wgi)  ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 5
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $economy $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 6
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $economy $energy  t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 7
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 8
xi: churdle linear log_chinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy auto_bin t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy auto_bin) ll(0) vce(cluster countryid)
outreg2 using "tableA5.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

* ====================================================================================================================================

*Table A6: Hurdle Model: Investment by non-Chinese MDBs (2005-2017)
*The sample period is split into to parts and the table presents how the Chinese and non-Chinese investment over 2005-2010 influences the non-Chinese investment in 2011-2017.

* ====================================================================================================================================
use "/workingdirectory/chinanonchina_mdb_iv.dta"

*Create globals


global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy " fdi_inflows_percgdp_0004mean log_gdppc log_population"
global economy_small "trade_perc_gdp_0004mean fdi_inflows_percgdp_0004mean log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"

encode country, gen(countryid)
keep if 2010<year
drop t t2 t3
gen t=year-2011
gen t2=t*t
gen t3=t*t*t
xtset countryid year

*Model 1
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum  t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum)  ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel  replace se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 2
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin)  ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")


*Model 3
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi)  ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) ///
addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes ///
addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 4
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $wgi t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $wgi)  ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 5
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $economy $energy)  ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 6
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $economy $energy  t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum auto_bin $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 7
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy) ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

*Model 8
xi: churdle linear log_nonchinafunding rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy auto_bin t t2 t3 i.region_wb, ///
select(rank_norm log_nonchina_finance_usd_0510sum log_chinamdb_fin_usd_0510sum $wgi $economy $energy auto_bin) ll(0) vce(cluster countryid)
outreg2 using "tableA6.xls" , excel append se label par dec(2) bdec(3) tdec(3) addstat("Countries", e(N_clust), "Pseudo R2", e(r2_p)) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "All models include region fixed effects and linear, quadratic and cubic time trends." "*p<.05; **p<.01; ***p<.001")

* ====================================================================================================================================

*Table A7: Probit Model: Investment by the Chinese MDBs (2005-2017)
*The table presents results from Probit selection models that analyze the determinants of the energy finance investment by the Chinese development banks.

* ====================================================================================================================================
use "/workingdirectory/china_energysources.dta"

*Create globals

global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy "fdi_inflows_percgdp_0004mean log_gdppc log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"

encode country_source, gen(countryenergyid)
xtset countryenergyid year

*Model 1

probit log_chinafunding rank_norm, vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel replace se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	

*Model 2

probit log_chinafunding rank_norm  i.energysourceid, vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 3
probit log_chinafunding rank_norm  i.energysourceid auto_bin,vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 4

probit log_chinafunding rank_norm  i.energysourceid $wgi, vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 5

probit log_chinafunding rank_norm  i.energysourceid $wgi auto_bin, vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 6

probit log_chinafunding rank_norm  i.energysourceid $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 7

probit log_chinafunding rank_norm  i.energysourceid auto_bin $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 8

probit log_chinafunding rank_norm  i.energysourceid $wgi $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 9

probit log_chinafunding rank_norm  i.energysourceid auto_bin $wgi $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA7.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

* ===================================================================================================================================

*Table A8: Probit Model: Investment by non-Chinese MDBs (2005-2017)
*The table presents results from Probit selection models that analyze the determinants of the energy finance investment by non-Chinese development banks.

* ====================================================================================================================================
use "/workingdirectory/nonchina_energysources.dta"

*Create globals

global wgi "political_stability_rounded corruption_rounded gov_effectiveness_rounded"
global economy "fdi_inflows_percgdp_0004mean log_gdppc log_population"
global energy "log_coalproduction_0004mean log_oilproduction_0004mean log_gasproduction_0004mean"

encode country_source, gen(countryenergyid)
xtset countryenergyid year


*Model 1

probit log_nonchinafunding rank_norm, vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel replace se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	

*Model 2

probit log_nonchinafunding rank_norm  i.energysourceid, vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 3
probit log_nonchinafunding rank_norm  i.energysourceid auto_bin,vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 4

probit log_nonchinafunding rank_norm  i.energysourceid $wgi, vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 5

probit log_nonchinafunding rank_norm  i.energysourceid $wgi auto_bin, vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")
	
*Model 6

probit log_nonchinafunding rank_norm  i.energysourceid $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 7

probit log_nonchinafunding rank_norm  i.energysourceid auto_bin $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 8

probit log_nonchinafunding rank_norm  i.energysourceid $wgi $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

*Model 9

probit log_nonchinafunding rank_norm  i.energysourceid auto_bin $wgi $economy $energy , vce(cluster countryenergyid)
outreg2 using "tableA8.xls" , excel append se label par dec(2) bdec(3) tdec(3) symbol(***, **, *) drop(t* _Iregion_*) nonotes addnote("Dependent Variable: Funding amount (log + 1). Standard errors in parentheses and clustered by country." "*p<.05; **p<.01; ***p<.001")

